<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center Eventdetails_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub Eventdetails_fd0_0'>
          <view class='flex flex-wrap align-center Eventdetails_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  Eventdetails_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='Eventdetails_fd0_0_c1_c0'>详情</text>
          </view>
          <view class='flex flex-wrap align-center justify-end Eventdetails_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout Eventdetails_flex_1">
        <view class='flex flex-wrap align-center flex-sub Eventdetails_fd1_0'>
          <text class='Eventdetails_fd1_0_c0' v-if="isform!=1">活动标题</text>
          <text v-if="isform!=1">{{info.template_name}}</text>
        </view>
        <view class='flex flex-direction align-stretch Eventdetails_fd1_1'>
          <view class='flex flex-wrap align-center justify-between flex-sub Eventdetails_fd1_1_c0'>
            <view class='flex flex-wrap align-center Eventdetails_fd1_1_c0_c0'>
              <text class='Eventdetails_fd1_1_c0_c0_c0'>*</text>
              <text>品牌贵宾</text>
            </view>
            <benben-input class='Eventdetails_fd1_1_c0_c1' v-model="user_name" type="text" :placeholder="`请输入`"
              confirm-type="done" :maxlength="10" :adjust-position='true' placeholder-style="color:#999;font-size:32rpx"
              :disabled="isform==1" />
          </view>
          <view class='flex flex-wrap align-center justify-between flex-sub Eventdetails_fd1_1_c0'
            @click.stop="openppipo">
            <view class='flex flex-wrap align-center Eventdetails_fd1_1_c0_c0'>
              <text class='Eventdetails_fd1_1_c0_c0_c0'>*</text>
              <text>预约日期</text>
            </view>
            <benben-input class='Eventdetails_fd1_1_c0_c1' type="text" v-model="appointment_date" :placeholder="`请选择`"
              confirm-type="done" :maxlength="-1" :adjust-position='true' :disabled='true'
              placeholder-style="color:#999;font-size:32rpx" />
          </view>
          <view class='flex flex-wrap align-center justify-between flex-sub Eventdetails_fd1_1_c0'>
            <view class='flex flex-wrap align-center Eventdetails_fd1_1_c0_c0'>
              <text class='Eventdetails_fd1_1_c0_c0_c0'>*</text>
              <text>预约时间</text>
            </view>
            <benben-input class='Eventdetails_fd1_1_c0_c1' type="text" :placeholder="`请输入`" v-model="appointment_time"
              confirm-type="done" :maxlength="20" placeholder-style="color:#999;font-size:32rpx"
              :disabled="isform==1" />
          </view>
        </view>
        <view class='flex flex-direction align-stretch Eventdetails_fd1_2'>
          <view class='flex flex-wrap align-center Eventdetails_fd1_1_c0_c0'>

            <view class='flex  Eventdetails_fd1_2_c0_c0'></view>

            <text class='Eventdetails_fd1_2_c0_c1'>展厅地址</text>
          </view>
          <view class='text-cut Eventdetails_fd1_2_c1'>
            <!-- {{info.address_province}}{{info.address_city}}{{info.address_district}}{{info.address_address}} -->
          </view>
          <view class='flex flex-wrap align-center Eventdetails_fd1_2_c2' @click.stop="openMap">
            <!-- <image class='Eventdetails_fd1_2_c2_c0' mode="aspectFit" :src='STATIC_URL+"148.png"'></image> -->
            <view class='flex flex-direction align-stretch flex-sub'>
              <text class='Eventdetails_fd1_2_c2_c1_c0'>MANLI BRIDAL</text>
              <view class='Eventdetails_fd1_2_c2_c1_c1'>
                {{info.address_province}}{{info.address_city}}{{info.address_district}}{{info.address_address}}
              </view>
            </view>
          </view>
          <view class='Eventdetails_fd1_2_c3'>
            <map :enable-scroll="false" :enable-zoom="false" style="width: 100%; height: 400rpx;" :latitude="latitude"
              :longitude="longitude" :markers="covers">
            </map>
          </view>

        </view>
        <view class='flex flex-direction align-stretch Eventdetails_fd1_2' v-if="info.yarn_info">
          <!-- <view class='flex flex-wrap align-center Eventdetails_fd1_1_c0_c0'>

            <view class='flex  Eventdetails_fd1_2_c0_c0'></view>

            <text class='Eventdetails_fd1_2_c0_c1'>试纱小贴士</text>
          </view> -->
          <view class="margin-top-xs">
            <jyf-parser :html="info.yarn_info | richTextFormat"></jyf-parser>
          </view>

        </view>
        <view class='flex flex-direction align-stretch Eventdetails_fd1_2'
          v-if="info.showroom_telephone || info.showroom_wx">
          <!-- <view class='flex flex-wrap align-center Eventdetails_fd1_1_c0_c0'>

            <view class='flex  Eventdetails_fd1_2_c0_c0'></view>

            <text class='Eventdetails_fd1_2_c0_c1'>联系方式</text>
          </view> -->
          <view class='flex flex-wrap align-center Eventdetails_fd1_4_c1' v-if="info.showroom_telephone">
            <text class='Eventdetails_fd1_4_c1_c0'>展厅电话</text>
            <text>{{info.showroom_telephone}}</text>
          </view>
          <view class='flex flex-wrap align-center Eventdetails_fd1_4_c1' v-if="info.showroom_wx">
            <text class='Eventdetails_fd1_4_c1_c0'>客服微信</text>
            <text>{{info.showroom_wx}}</text>
          </view>
        </view>
        <view class='flex flex-direction align-stretch Eventdetails_fd1_2' v-if="info.parking_instruction">
          <!-- <view class='flex flex-wrap align-center Eventdetails_fd1_1_c0_c0'>

            <view class='flex  Eventdetails_fd1_2_c0_c0'></view>

            <text class='Eventdetails_fd1_2_c0_c1'>泊车指引</text>
          </view> -->
          <view class="margin-top-xs">
            <jyf-parser :html="info.parking_instruction | richTextFormat"></jyf-parser>
          </view>

          <!-- <text
            class='Eventdetails_fd1_3_c1'>平安金融中心C座B1-B4，停好车后找到C座黄铜色电梯，乘坐电梯至一楼大堂，从大堂乘坐12-23楼的高区电梯至23层顶楼不经过一楼大堂电梯无法上来高区</text> -->
          <!-- <image class='Eventdetails_fd1_2_c3' mode="aspectFill" :src='STATIC_URL+"149.png"'></image> -->
        </view>

      </view>

      <!---flex布局flex布局结束-->
      <view class="btton-box" v-if="isform!=1">
        <button @click.stop="submit" class='Eventdetails_fd1_6'>保存并分享</button>
      </view>
      <benben-popup v-model="popupShow1706715717630" :mask="true" :mask-close-able="true" mode='center' :z-index='999'>
        <!---flex布局flex布局开始-->
        <view class="releaseSale_flex_4">
          <view class='text-white'>温馨提示</view>
          <view class="margin-tb-lg" style="color: #FFF;">
            您的<text>{{info.template_name}}</text>模板已保存成功，请点击下方分享给<text>{{user_name}}</text>客户
          </view>
          <button open-type="share" @click.stop="popupShow1706715717630=false"
            class='flex flex-direction flex-wrap align-center'>
            立即分享
          </button>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>
      <benben-picker ref="benbenWritePickerCodepicker3" :visible.sync="pickerDiy1719212019101"
        :value.sync='appointment_date' mode='date' :picker-height='88' :current='true' :mask-show='true' fields='day'
        :timeout='true' start-year='现在' end-year='2050-12-31'>
        <template #picker-header>
          <view class='flex flex-wrap align-center justify-between newCustomer_picker3_0'>
            <text @tap="$refs.benbenWritePickerCodepicker3.cancel()">取消</text>
            <text>选择日期</text>
            <text class='newCustomer_picker3_0_c2' @click.stop="closeTime">确认</text>
          </view>
        </template>
      </benben-picker>
    </view>
  </page-body>
</template>
<script>
  export default {
    components: {},


    data() {
      return {
        popupShow1706715717630: false,
        pickerDiy1719212019101: false,
        "aid": "",
        user_name: '',
        appointment_date: '',
        appointment_time: '',
        activetemplate_id: '',
        info: '',
        isform: '',
        shareid: '',
        latitude: '',
        longitude: '',
        covers: [],
        scale: 3
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      let {
        aid,
        isform
      } = options
      if (aid !== undefined) this.aid = aid
      if (isform !== undefined) this.isform = isform
      this.getDetail()
    },
    onUnload() {

    },
    onReady() {

    },
    onShareAppMessage() {
      return {
        title: this.info.template_name,
        path: `/pages/grzx/Eventdetails/Eventdetails?aid=${this.shareid}&isform=1`,
      }
    },
    onShow() {

    },
    onHide() {
      this.popupShow1706715717630 = false
    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      openMap() {
        uni.openLocation({
          latitude: this.latitude,
          longitude: this.longitude,
          name: this.info.address_address,
          success: function() {
            console.log('success');
          }
        });
      },
      openppipo() {
        if (this.isform == 1) {
          return
        }
        this.pickerDiy1719212019101 = true
      },
      closeTime() {
        this.$refs.benbenWritePickerCodepicker3.pickerConfirm()
      },
      getDetail() {
        let urls = ''
        if (this.isform == 1) { //分享的

          urls = global.apiUrls.post666c15837eebe
        } else {
          urls = global.apiUrls.post668640ec72b34
        }
        this.$api.post(urls, {
          aid: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.info = res.data.data
            if (this.isform == 1) {
              this.user_name = res.data.data.user_name
              this.appointment_date = res.data.data.appointment_date
              this.appointment_time = res.data.data.appointment_time
            }
            this.latitude = parseFloat(this.info.address_lat)
            this.longitude = parseFloat(this.info.address_lng)
            console.log('pp', this.latitude)
            this.covers = [{
              latitude: this.latitude,
              longitude: this.longitude,
              // iconPath: '../../../static/location.png',
              width: 12,
              height: 20
            }]
          }
        })
      },
      submit() {
        if (!this.user_name) {
          this.$message.info('请输入客户姓名')
          return;
        }
        if (!this.appointment_date) {
          this.$message.info('请选择时间')
          return;
        }
        if (!this.appointment_time) {
          this.$message.info('请输入时间段')
          return;
        }
        this.$api.post(global.apiUrls.post666c146edc9ed, {
          user_name: this.user_name,
          appointment_date: this.appointment_date,
          appointment_time: this.appointment_time,
          activetemplate_id: this.aid
        }).then(res => {
          if (res.data.code == 1) {
            this.shareid = res.data.data.aid
            // uni.navigateBack()
            this.popupShow1706715717630 = true
          }
        })
      },
    }
  };
</script>
<style lang="scss" scoped>
  .releaseSale_flex_4 {
    // background: rgba(255, 255, 255, 1);
    background: #312e2ea8;
    border-radius: 40rpx;
    width: 540rpx;
    padding: 32rpx;
    text-align: center;
  }

  button {
    width: 400rpx;
    height: 60rpx;
    line-height: 60rpx;
    background: #F9E4C3;
    border-radius: 16rpx;
    margin: 0 auto;
    font-size: 28rpx;
    color: rgba(0, 0, 0, 0.6);
  }

  .releaseSale_fd4_0_c1_c0_c1 {
    color: #333333;
    margin: 16rpx 0rpx 0rpx 0rpx;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 46rpx;
  }

  .releaseSale_fd4_0_c1_c0_c0 {
    width: 80rpx;
    height: 80rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c1 {
    margin: 50rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c2 {
    width: 40rpx;
    height: 40rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c1_c1 {
    margin: 0rpx 20rpx 0rpx 20rpx;
    color: #333333;
    font-size: 32rpx;
    font-weight: 400;
    line-height: 46rpx;
  }

  .releaseSale_fd4_0_c0_c1_c0 {
    width: 28rpx;
    height: 10rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .releaseSale_fd4_0_c0_c0 {
    width: 40rpx;
    height: 40rpx;
  }

  .releaseSale_fd4_0_c0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .releaseSale_fd4_0 {
    padding: 40rpx 0rpx 56rpx 0rpx;
  }





  .newCustomer_picker3_0_c2 {
    color: #d39850;
  }

  // 取消地图上的 logo
  a .csssprite {
    display: none;
  }

  .newCustomer_picker3_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
    border-radius: 25rpx 25rpx 0rpx 0rpx;
    background-size: 100% auto !important;
  }

  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 248, 238, 1);
    background-size: 100% auto;
  }

  .Eventdetails_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .Eventdetails_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .Eventdetails_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .Eventdetails_fd0_0_c0 {
    width: 120rpx;
  }

  .Eventdetails_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .Eventdetails_flex_1 {
    padding: 0rpx 32rpx 150rpx 32rpx;
  }

  .btton-box {
    position: fixed;
    bottom: 0rpx;
    width: 750rpx;
    left: 0;
    background-color: #FFF;
    padding: 12rpx 0;
  }

  .Eventdetails_fd1_6 {
    background: #F9E4C3;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor0);
    height: 88rpx;
    margin: 0 auto 0rpx auto;
  }

  .Eventdetails_fd1_4_c1_c0 {
    width: 150rpx;
    color: rgba(153, 153, 153, 1);
  }

  .Eventdetails_fd1_4_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
    font-size: 32rpx;
  }

  .Eventdetails_fd1_3_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .Eventdetails_fd1_2_c3 {
    width: 646rpx;
    height: 400rpx;
    border-radius: 16rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .Eventdetails_fd1_2_c2_c1_c1 {
    color: var(--benbenFontColor0);
    margin: 24rpx 0rpx 0rpx 0rpx;
    max-width: 620rpx;
    // -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .Eventdetails_fd1_2_c2_c1_c0 {
    color: rgba(211, 152, 80, 1);
    // color: #333333;
    font-size: 36rpx;
  }

  .Eventdetails_fd1_2_c2_c0 {
    width: 60rpx;
    height: 60rpx;
    margin: 0rpx 26rpx 0rpx 0rpx;
  }

  .Eventdetails_fd1_2_c2 {
    background: rgba(255, 248, 238, 1);
    background-size: 100% auto;
    border-radius: 16rpx;
    padding: 24rpx;
  }

  .Eventdetails_fd1_2_c1 {
    margin: 24rpx 0rpx 24rpx 0rpx;
    width: 648rpx;
  }

  .Eventdetails_fd1_2_c0_c1 {
    margin: 0rpx 0rpx 0rpx 20rpx;
  }

  .Eventdetails_fd1_2_c0_c0 {
    background: url(image-path('159.png')) no-repeat;
    width: 14rpx;
    height: 28rpx;
    background-size: 100% 100% !important;
    margin: 2rpx 0 0rpx 0;
    transform: scaleX(0.5);
  }

  .Eventdetails_fd1_2 {
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    border-radius: 16rpx;
    padding: 24rpx;
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .Eventdetails_fd1_1_c0_c1 {
    text-align: right;
  }

  .Eventdetails_fd1_1_c0_c0_c0 {
    color: var(--benbenFontColor5);
  }

  .Eventdetails_fd1_1_c0_c0 {
    font-size: 32rpx;
  }

  .Eventdetails_fd1_1_c0 {
    border-bottom: 1px solid #eee;
    padding: 24rpx 0rpx 24rpx 0rpx;
  }

  .Eventdetails_fd1_1 {
    background: var(--benbenbgColor1);
    background-size: 100% auto;
    border-radius: 16rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .Eventdetails_fd1_0_c0 {
    width: 150rpx;
  }

  .Eventdetails_fd1_0 {
    padding: 32rpx 0rpx 32rpx 0rpx;
    font-size: 32rpx;
  }
</style>
